package com.lg.desireplayer.util;

import java.io.BufferedInputStream;
import java.net.URL;
import java.net.URLConnection;

import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.widget.Toast;

import com.lg.desireplayer.bandinfo.ViewBandinfo;

public class GetImageFromURL {
	
	
	
	
	public GetImageFromURL(){}

	public static Bitmap setImage(int id)
	{
		
		String strImageURL="http://192.168.0.131/images/" + id +".jpg";
		
		Bitmap imgBitmap = null;
		
				try
		
				{
		
					URL url = new URL(strImageURL);
		
					URLConnection conn = url.openConnection();
		
					conn.connect();
		
					int nSize = conn.getContentLength();
		
					BufferedInputStream bis = new BufferedInputStream(
							conn.getInputStream(), nSize);
		
					imgBitmap = BitmapFactory.decodeStream(bis);
		
					bis.close();
		
				}
		
				catch (Exception e)
		
				{
		
					return null;
					
				
		
				}
		
				return imgBitmap;
	
	
	}
}
